

<style type="text/css" title="currentStyle">
    @import "../tabla/demo_page.css";
    @import "../tabla/demo_table.css";
    @import "../examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css";
    .ui-datepicker{
        display:none;
    }
</style>
<link rel="stylesheet" type="text/css" href="../style/style.css"/>
<link rel="stylesheet" type="text/css" href="nivo-slider.css"/>
<script type="text/javascript" language="javascript" src="../tabla/jquery.js"></script>
<script type="text/javascript" language="javascript" src="../tabla/jquery.dataTables.js"></script>


<script type="text/javascript" src="../js/jquery.nivo.slider.pack.js"></script>


<link rel="stylesheet" href="../css/jquery.ui.all.css">

<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="style/demos.css">

<script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
</script>

<script type="text/javascript">
    $(function() {
        var dates = $( "#from, #to" ).datepicker({
            defaultDate: "-5w",
            changeMonth: true,
            numberOfMonths: 3,
            onSelect: function( selectedDate ) {
                var option = this.id == "from" ? "minDate" : "maxDate",
                instance = $( this ).data( "datepicker" ),
                date = $.datepicker.parseDate(
                instance.settings.dateFormat ||
                    $.datepicker._defaults.dateFormat,
                selectedDate, instance.settings );
                dates.not( this ).datepicker( "option", option, date );
            }
        });
    });
</script>
<script type="text/javascript">
    function valida_envia(){
        //valido el nombre
        if (document.frm_rango.from.value.length==0 || document.frm_rango.to.value.length==0){
            alert("Seleccione un rango de fechas...")
            location.href="reportes2.php";
            return 0;
        } 
        else {return 1;}
    }
</script>

<!-- content begins -->

<div class="content"> 
    <input type="hidden"  style="width:80;" id="reporte_id" name="reporte_id" value="2"  />

    <center>
        <div id="fechas">
            <div class="demo">
                <form id="frm_rango" name="frm_rango" method="post" action="reportes.php" >
                    <label for="from" class="lbl">De</label>
                    <input type="text" class="input_fecha" style="width:80;" id="from" name="from"  />
                    <input type="hidden"  style="width:80;" id="from2" name="from2" value="<?php echo $_POST['from'] ?>"  />
                    <label for="to" class="lbl">hasta</label>
                    <input type="text" class="input_fecha" id="to"  style="width:80;" name="to" />
                    <input type="hidden"  style="width:80;" id="to2" name="to2" value="<?php echo $_POST['to'] ?>"  />
                    <input type="submit" class="but" name="generar" value="Generar Reporte" id="generar"  onclick="valida_envia();" />
                </form>
            </div><!-- End demo -->
        </div>
        <div id="contenedor">	

            <?php
            if (isset($_POST['generar'])) {
                if (strlen($_POST['from']) > 0) {
                    if (strlen($_POST['to']) > 0) {
                        $fecha_ini = $_POST['from'];
                        $fecha_fin = $_POST['to'];
                    }
                }
            }
            if (isset($_GET['from'])) {
                if (strlen($_GET['from']) > 0) {
                    if (strlen($_GET['to']) > 0) {
                        $fecha_ini = $_GET['from'];
                        $fecha_fin = $_GET['to'];
                    }
                }
            }

            if (strlen($fecha_fin) > 0) {
                echo "<table>";
                echo "<tr>";
                echo "<td>";
                /* echo "<img src='barraR1.php?fecha_ini=".$_POST['from']."&fecha_fin=".$_POST['to']."' alt='' border='0'>"; */
                include("../graf_conversaciones.php");



                echo "</td>";
                echo "</tr>";

                echo "<tr>";
                echo "<td align=\"center\">";

                include("reporte1.php");

                echo "</td>";
                echo "</tr>";

                /* echo "<tr>";
                  echo "<td>";
                  echo "<img src='torta.php?fecha_ini=".$_POST['from']."&fecha_fin=".$_POST['to']."' alt='' border='0'>";
                  echo "</td>";
                  echo "</tr>";
                  echo "<tr>";
                  echo "<td>";
                  include("tabla_reporte.php");
                  echo "</td>";
                  echo "</tr>"; */

                echo "</table>";
            }
            ?>

        </div> 

    </center>
</div>
</center>

